<?php /* Smarty version 2.6.26, created on 2011-12-16 09:28:20
         compiled from en_gb_prepare.tpl */ ?>
<?php if (! $this->_tpl_vars['EMBEDDED_REPORT']): ?> 
<HTML>
<HEAD>
<TITLE><?php echo $this->_tpl_vars['TITLE']; ?>
</TITLE>
<LINK id="reportico_css" REL="stylesheet" TYPE="text/css" HREF="<?php echo $this->_tpl_vars['STYLESHEET']; ?>
">
</HEAD>
<BODY class="swPrpBody">
<?php else: ?>
<LINK id="reportico_css" REL="stylesheet" TYPE="text/css" HREF="<?php echo $this->_tpl_vars['STYLESHEET']; ?>
">
<?php endif; ?>


<?php if ($this->_tpl_vars['AJAX_ENABLED']): ?> 
<script type="text/javascript" src="<?php echo $this->_tpl_vars['JSPATH']; ?>
/jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['JSPATH']; ?>
/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['JSPATH']; ?>
/ui/jquery.ui.datepicker.js"></script>
<LINK id="reportico_css" REL="stylesheet" TYPE="text/css" HREF="<?php echo $this->_tpl_vars['JSPATH']; ?>
/ui/themes/base/jquery.ui.all.css">
<?php endif; ?>

<FORM class="swPrpForm" id="criteriaform" name="topmenu" method="POST" action="<?php echo $this->_tpl_vars['SCRIPT_SELF']; ?>
">
<h1 class="swTitle"><?php echo $this->_tpl_vars['TITLE']; ?>
</h1>
<input type="hidden" name="session_name" value="<?php echo $this->_tpl_vars['SESSION_ID']; ?>
" />
<?php if ($this->_tpl_vars['SHOW_TOPMENU']): ?>
	<TABLE class="swPrpTopMenu">
		<TR>
<?php if (( $this->_tpl_vars['DB_LOGGEDON'] )): ?> 
			<TD style="width: 10px" class="swPrpTopMenuCell">
			</TD>
<?php endif; ?>
<?php if (strlen ( $this->_tpl_vars['MAIN_MENU_URL'] ) > 0): ?> 
			<TD style="text-align:left">
				<a class="swLinkMenu" href="<?php echo $this->_tpl_vars['MAIN_MENU_URL']; ?>
">Project Menu</a>
<?php if ($this->_tpl_vars['SHOW_DESIGN_BUTTON']): ?>
                                &nbsp;<input class="swLinkMenu" type="submit" name="submit_design_mode" value="Design Report">
<?php endif; ?>

<?php endif; ?>
			</TD>
<?php if ($this->_tpl_vars['SHOW_LOGOUT']): ?>
			<TD style="width:15%; text-align: right; padding-right: 10px;" class="swPrpTopMenuCell">
				<input class="swLinkMenu" type="submit" name="logout" value="Log Off">
			</TD>
<?php endif; ?>
<?php if ($this->_tpl_vars['SHOW_LOGIN']): ?>
			<TD width="10%"></TD>
			<TD width="55%" align="left" class="swPrpTopMenuCell">
<?php if (strlen ( $this->_tpl_vars['PASSWORD_ERROR'] ) > 0): ?>
                                <div style="color: #ff0000;"><?php echo $this->_tpl_vars['PASSWORD_ERROR']; ?>
</div>
<?php endif; ?>
				Enter the report project password. <br>(If you have a design mode password then you can enter this to create and configure reports)<br><input type="password" name="project_password" value=""></div>
				<input class="swLinkMenu" type="submit" name="login" value="Login">
			</TD>
<?php endif; ?>
		</TR>
	</TABLE>
<?php endif; ?>
<div id="criteriabody">
<?php if ($this->_tpl_vars['SHOW_CRITERIA']): ?>
	<TABLE class="swPrpCritBox" id="critbody" cellpadding="0">
<?php if ($this->_tpl_vars['SHOW_OUTPUT']): ?>
								<TR>
									<td width="10%">
										&nbsp;
									</TD>
									<TD width="40%">
										&nbsp;
										Output :
											<INPUT type="radio" name="target_format" value="HTML" <?php echo $this->_tpl_vars['OUTPUT_TYPES'][0]; ?>
>HTML
											<INPUT type="radio" name="target_format" value="PDF" <?php echo $this->_tpl_vars['OUTPUT_TYPES'][1]; ?>
>PDF
											<INPUT type="radio" name="target_format" value="CSV" <?php echo $this->_tpl_vars['OUTPUT_TYPES'][2]; ?>
>CSV
											<INPUT type="radio" name="target_format" value="XML" <?php echo $this->_tpl_vars['OUTPUT_TYPES'][3]; ?>
>XML
											<INPUT type="radio" name="target_format" value="JSON" <?php echo $this->_tpl_vars['OUTPUT_TYPES'][4]; ?>
>JSON
									<td width="30%" style="vertical-align: top">
										<!--INPUT type="checkbox" name="target_attachment" value="1" <?php echo $this->_tpl_vars['OUTPUT_ATTACH']; ?>
>As Attachment</INPUT-->
										&nbsp;
										<INPUT type="checkbox" name="target_show_criteria" value="1" <?php echo $this->_tpl_vars['OUTPUT_SHOWCRITERIA']; ?>
>Show Criteria</INPUT>
<?php if ($this->_tpl_vars['OUTPUT_SHOW_SHOWGRAPH']): ?>
										<INPUT type="checkbox" name="target_show_graph" value="1" checked>Show Graph</INPUT><BR>
<?php endif; ?>
									</td>
<?php if ($this->_tpl_vars['OUTPUT_SHOW_DEBUG']): ?>
									<td width="20%" style="vertical-align: top">
<?php if ($this->_tpl_vars['SHOW_DESIGN_BUTTON']): ?>

										Debug Level:
										<SELECT class="swRunMode" name="debug_mode">';
											<OPTION <?php echo $this->_tpl_vars['DEBUG_NONE']; ?>
 label="None" value="0">None</OPTION>
											<OPTION <?php echo $this->_tpl_vars['DEBUG_LOW']; ?>
 label="Low" value="1">Low</OPTION>
											<OPTION <?php echo $this->_tpl_vars['DEBUG_MEDIUM']; ?>
 label="Medium" value="2">Medium</OPTION>
											<OPTION <?php echo $this->_tpl_vars['DEBUG_HIGH']; ?>
 label="High" value="3">High</OPTION>
										</SELECT>
<?php endif; ?>
										<BR>
									</td>
<?php endif; ?>
								</TR>
<?php else: ?>
<?php endif; ?>
	</TABLE>
	<TABLE class="swPrpCritBox" cellpadding="0">
<!---->
		<TR id="swPrpCriteriaBody">
			<TD class="swPrpCritEntry">
			<div id="swPrpSubmitPane">
    				<input type="submit" id="prepareAjaxExecute" name="submitPrepare" value="Go">
    				<input type="submit" name="prepareAjaxExpand" value="Reset">
			</div>

                <TABLE class="swPrpCritEntryBox"">
<?php if (isset ( $this->_tpl_vars['CRITERIA_ITEMS'] )): ?>
<?php unset($this->_sections['critno']);
$this->_sections['critno']['name'] = 'critno';
$this->_sections['critno']['loop'] = is_array($_loop=$this->_tpl_vars['CRITERIA_ITEMS']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['critno']['show'] = true;
$this->_sections['critno']['max'] = $this->_sections['critno']['loop'];
$this->_sections['critno']['step'] = 1;
$this->_sections['critno']['start'] = $this->_sections['critno']['step'] > 0 ? 0 : $this->_sections['critno']['loop']-1;
if ($this->_sections['critno']['show']) {
    $this->_sections['critno']['total'] = $this->_sections['critno']['loop'];
    if ($this->_sections['critno']['total'] == 0)
        $this->_sections['critno']['show'] = false;
} else
    $this->_sections['critno']['total'] = 0;
if ($this->_sections['critno']['show']):

            for ($this->_sections['critno']['index'] = $this->_sections['critno']['start'], $this->_sections['critno']['iteration'] = 1;
                 $this->_sections['critno']['iteration'] <= $this->_sections['critno']['total'];
                 $this->_sections['critno']['index'] += $this->_sections['critno']['step'], $this->_sections['critno']['iteration']++):
$this->_sections['critno']['rownum'] = $this->_sections['critno']['iteration'];
$this->_sections['critno']['index_prev'] = $this->_sections['critno']['index'] - $this->_sections['critno']['step'];
$this->_sections['critno']['index_next'] = $this->_sections['critno']['index'] + $this->_sections['critno']['step'];
$this->_sections['critno']['first']      = ($this->_sections['critno']['iteration'] == 1);
$this->_sections['critno']['last']       = ($this->_sections['critno']['iteration'] == $this->_sections['critno']['total']);
?>
                    <tr class="swPrpCritLine" id="criteria_<?php echo $this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['name']; ?>
">
                        <td class='swPrpCritTitle'>
                            <?php echo $this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['title']; ?>

                        </td>
                        <td class="swPrpCritSel">
                            <?php echo $this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['entry']; ?>

                        </td>
                        <td class="swPrpCritExpandSel">
<?php if ($this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['expand']): ?>
<?php if ($this->_tpl_vars['AJAX_ENABLED']): ?> 
                            <input class="swPrpCritExpandButton" id="prepareAjaxButton" type="button" name="EXPAND_<?php echo $this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['name']; ?>
" value=">>">
<?php else: ?>
                            <input class="swPrpCritExpandButton" type="submit" name="EXPAND_<?php echo $this->_tpl_vars['CRITERIA_ITEMS'][$this->_sections['critno']['index']]['name']; ?>
" value=">>">
<?php endif; ?>
<?php endif; ?>
                        </td>
                    </TR>
<?php endfor; endif; ?>
<?php endif; ?>
                </TABLE>
<?php if (isset ( $this->_tpl_vars['CRITERIA_ITEMS'] )): ?>
<?php if (count ( $this->_tpl_vars['CRITERIA_ITEMS'] ) > 1): ?>
<div id="swPrpSubmitPane">
    <input type="submit" id="prepareAjaxExecute" name="submitPrepare" value="Go">
    <input type="submit" name="prepareAjaxExpand" value="Reset">
</div>
<?php endif; ?>
<?php endif; ?>
			</td>
			<TD class="swPrpExpand">
				<TABLE class="swPrpExpandBox">
					<TR class="swPrpExpandRow">
						<TD id="swPrpExpandCell" rowspan="0" valign="top">
<?php if (strlen ( $this->_tpl_vars['ERRORMSG'] ) > 0): ?>
            <TABLE class="swError">
                <TR>
                    <TD><?php echo $this->_tpl_vars['ERRORMSG']; ?>
</TD>
                </TR>
            </TABLE>
<?php endif; ?>
<?php if (strlen ( $this->_tpl_vars['STATUSMSG'] ) > 0): ?> 
			<TABLE class="swStatus">
				<TR>
					<TD><?php echo $this->_tpl_vars['STATUSMSG']; ?>
</TD>
				</TR>
			</TABLE>
<?php endif; ?>
<?php if (strlen ( $this->_tpl_vars['STATUSMSG'] ) == 0 && strlen ( $this->_tpl_vars['ERRORMSG'] ) == 0): ?>
<div style="float:right; ">
<?php if (strlen ( $this->_tpl_vars['MAIN_MENU_URL'] ) > 0): ?>
<!--a class="swLinkMenu" style="float:left;" href="<?php echo $this->_tpl_vars['MAIN_MENU_URL']; ?>
">&lt;&lt; Menu</a-->
<?php endif; ?>
</div>
<p>
<?php if ($this->_tpl_vars['SHOW_EXPANDED']): ?>
							Search <?php echo $this->_tpl_vars['EXPANDED_TITLE']; ?>
 :<br><input  type="text" name="expand_value" size="30" value="<?php echo $this->_tpl_vars['EXPANDED_SEARCH_VALUE']; ?>
"</input>
									<input id="prepareAjaxButton" class="swPrpSubmit" type="submit" name="EXPANDSEARCH_<?php echo $this->_tpl_vars['EXPANDED_ITEM']; ?>
" value="Search"><br>

<?php echo $this->_tpl_vars['CONTENT']; ?>

							<br>
							<input class="swPrpSubmit" type="submit" name="EXPANDCLEAR_<?php echo $this->_tpl_vars['EXPANDED_ITEM']; ?>
" value="Clear">
							<input class="swPrpSubmit" type="submit" name="EXPANDSELECTALL_<?php echo $this->_tpl_vars['EXPANDED_ITEM']; ?>
" value="Select All">
							<input class="swPrpSubmit" type="submit" name="EXPANDOK_<?php echo $this->_tpl_vars['EXPANDED_ITEM']; ?>
" value="OK">
<?php endif; ?>
<?php if (! $this->_tpl_vars['SHOW_EXPANDED']): ?>
<?php if (! $this->_tpl_vars['REPORT_DESCRIPTION']): ?>
						&nbsp<br>
						Enter Your Report Criteria Here. To enter criteria use the appropriate expand key.
						When you are happy select the appropriate output format and click OK.
<?php else: ?>
						&nbsp<br>
						<?php echo $this->_tpl_vars['REPORT_DESCRIPTION']; ?>

<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
						</TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
			</TABLE>

<?php endif; ?>
</div>
			<!---->

	</TABLE>
</FORM>
<div class="smallbanner">Powered by <a href="http://www.reportico.org/" target="_blank">reportico <?php echo $this->_tpl_vars['REPORTICO_VERSION']; ?>
</a></div>
<?php if (! $this->_tpl_vars['EMBEDDED_REPORT']): ?> 
</BODY>
</HTML>
<?php endif; ?>

<?php if ($this->_tpl_vars['AJAX_ENABLED']): ?> 
<?php echo '
<script>
jQuery(function($) { 
$(document).ready(function(){
	$(function() {
		$(".swDateField").each(function(){
                                        $(this).datepicker({dateFormat: "'; ?>
<?php echo $this->_tpl_vars['AJAX_DATEPICKER_FORMAT']; ?>
<?php echo '"});
                              });

	});
	$(\'#prepareAjaxExpand\').live(\'click\', function() {
       		$("#swPrpExpandCell").addClass("loading");
		var ajaxaction = "'; ?>
<?php echo $this->_tpl_vars['AJAX_PARTIAL_RUNNER']; ?>
<?php echo '";
		
       		$.ajax({
           			type: \'POST\',
            		url: ajaxaction,
            		data: $("#criteriaform").serialize() + \'&partial_template=critbody&execute_mode=PREPARE&\' + $(this).attr(\'name\') + \'=\' + $(this).attr(\'value\'),
           			dataType: \'html\',
           			success: function(data, status) {
       					$("#swPrpExpandCell").removeClass("loading");
                   			$("#criteriabody").attr(\'innerHTML\',data);
           			},
           			error: function(xhr, desc, err) {
       					$("#swPrpExpandCell").removeClass("loading");
       					$("#criteriabody").attr(\'innerHTML\',\'Error in lookup option\');
          			}
       		});
		return false;
	});
	$(\'#prepareAjaxButton\').live(\'click\', function() {
       		$("#swPrpExpandCell").addClass("loading");
		var ajaxaction = "'; ?>
<?php echo $this->_tpl_vars['AJAX_PARTIAL_RUNNER']; ?>
<?php echo '";
       		$.ajax({
           			type: \'POST\',
            		url: ajaxaction,
            		data: $("#criteriaform").serialize() + \'&partial_template=expand&execute_mode=PREPARE&\' + $(this).attr(\'name\') + \'=\' + $(this).attr(\'value\'),
           			dataType: \'html\',
           			success: function(data, status) {
       					$("#swPrpExpandCell").removeClass("loading");
                   			$("#swPrpExpandCell").attr(\'innerHTML\',data);
           			},
           			error: function(xhr, desc, err) {
       					$("#swPrpExpandCell").removeClass("loading");
       					$("#swPrpExpandCell").attr(\'innerHTML\',\'Error in lookup option\');
          			}
       		});
		return false;
	});
	$(\'#ignoreprepareAjaxExecute\').click(function() {
		//$("#swPrpExpandCell").attr(\'innerHTML\',"Loading");
		var ajaxaction = "'; ?>
<?php echo $this->_tpl_vars['AJAX_PARTIAL_RUNNER']; ?>
<?php echo '";
       		$("#swPrpExpandCell").addClass("loading");
            		url: ajaxaction,
       		$.ajax({
           			type: \'POST\',
            		url: $("#criteriaform").attr(\'action\'),
            		data: $("#criteriaform").serialize() + \'&\' + $(this).attr(\'name\') + \'=\' + $(this).attr(\'value\'),
           			dataType: \'html\',
           			success: function(data, status) {
       					$("#swPrpExpandCell").removeClass("loading");
                   			$("#swPrpExpandCell").attr(\'innerHTML\',data);
           			},
           			error: function(xhr, desc, err) {
       					$("#swPrpExpandCell").removeClass("loading");
       					$("#swPrpExpandCell").attr(\'innerHTML\',\'Error in lookup option\');
          			}
       		});
		return false;
	});
});
});
</script>
'; ?>

<?php endif; ?>